import '../css/index.scss'
import axios from '../../node_modules/axios/dist/axios.js'
import Vue from '../../node_modules/vue/dist/vue.js'
import scroll from '../../node_modules/better-scroll/dist/bscroll.js'
new Vue({
    el: '.wrap',
    data: {

    },
    mounted() {
        axios.get('/api/list').then(function(data) {
            return new Promise(function(resolve, reject) {
                let con = document.querySelector('.con');
                let wrap = document.querySelector('.wrap')
                new scroll(wrap);
                data.data.data.forEach(function(item, index) {
                    setTimeout(function() {
                        let p = document.createElement('p');
                        con.appendChild(p);
                        p.innerHTML = item;
                        resolve(p)
                    }, 1000 * index)
                })
            })
        }).catch(function(err) {
            console.log(err)
        })
    },
})